import { useEffect, useMemo, useState } from 'react'

import './App.css'
import { toast, initGlobalToast } from './utils/toast'
import DialogBooks from './DialogBooks'
import BbListProvider from './context/BbListProvider'

function App() {
  const [count, setCount] = useState(0)
  useEffect(() => {
    initGlobalToast()
    // setTimeout(() => {
    //   toast('22222是姐姐都觉得姐姐', 'success')
    // }, 1000)
  }, [])
  // 缓存 value，避免重复创建对象
  const contextValue = useMemo(() => {
    return {
      items: [
        {
          name: '',
          des: '芙蓉仙子001',
          jnList: [],
        },
      ],
      index: 0,
      
    }
  })

  return (
    <>
      <BbListProvider>
        <DialogBooks></DialogBooks>
      </BbListProvider>
    </>
  )
}

export default App
